Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce executeSubscriptionEvent #3657

Closed
wants to merge 5 commits into from

Conversation

yaacovCR
Copy link
Contributor

@yaacovCR yaacovCR commented Jun 22, 2022

to replace the old exported functionality removed from execute by #3644

depends on #3644

@netlify
Copy link

netlify bot commented Jun 22, 2022

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit c23fd59
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/62b36e14a8525a00093141e8
😎 Deploy Preview https://deploy-preview-3657--compassionate-pike-271cb3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@yaacovCR yaacovCR requested a review from a team June 22, 2022 02:34
@github-actions
Copy link

Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

@yaacovCR yaacovCR added the PR: bug fix 🐞 requires increase of "patch" version number label Jun 22, 2022
yaacovCR added 3 commits June 22, 2022 21:39
The `execute`/`executeImpl` and `createSourceEventStream`/`createSourceEventStreamImpl` functions follow the same basic pattern of building the contet and using it to run a function. This PR extracts that pattern into a separate function.

For good measure, the same pattern in applied to the soon-to-be-deprecated `subscribe` function.

Hheavier refactoring is on the way from @IvanGoncharov (see graphql#3639 (review)), but in the meantime, this consolidates the common pattern without any breaking changes.
...to executeSubscriptionRootField => because that's what it does!
...because that's what it does!

The execution of an operation returns a map of data/errors, not just the data.
@yaacovCR yaacovCR force-pushed the execute-sub-event branch from ab12f8a to dce4720 Compare June 22, 2022 19:29
yaacovCR added 2 commits June 22, 2022 22:31
`execute` no longer runs the query algorithm for subscription operations. Rather, subscription operations are performed, as per the spec. `subscribe` is deprecated.
to replace the old exported functionality from execute
@yaacovCR yaacovCR force-pushed the execute-sub-event branch from dce4720 to c23fd59 Compare June 22, 2022 19:31
@yaacovCR yaacovCR added PR: feature 🚀 requires increase of "minor" version number and removed PR: bug fix 🐞 requires increase of "patch" version number labels Jun 22, 2022
Copy link
Member

@IvanGoncharov IvanGoncharov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we are back to square one where we duplicate work done by createSourceEventStream.
Adding a new API means we can't easily change or remove it so we need to solve the problem of duplicating work.
In #3658 I proposed exact same API but without this problem.
Merging this PR restricts design space for figuring out how to remove this duplication.
So I want to resolve the problem of duplication before merging it, so we sure API is compatible with this solution.

I think it's fair to block this change since a full alternative is provided in #3658

@yaacovCR
Copy link
Contributor Author

yaacovCR commented Jun 23, 2022

I don't understand, this is for use in a separate service that is set up to only run this function to manage subscriptions, so there is duplicative work of coercing because it is done by a separate service. We have discussed already how CreateSourceEventStream is not commonly used but this is available now for those who need it.

I do not see how your PR provides an alternative without this additional work if indeed run as two services.

@yaacovCR
Copy link
Contributor Author

I am folding this into #3644 because it provides functionality that was removed from by #3644. It makes sense to make it a separate commit within that PR.

@yaacovCR yaacovCR closed this Jun 23, 2022
@yaacovCR yaacovCR deleted the execute-sub-event branch June 24, 2022 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: feature 🚀 requires increase of "minor" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants